package com.ostrich.cloud.ostrichManagerWeb.app.controller;

import com.ostrich.cloud.common.result.Result;
import com.ostrich.cloud.ostrichManagerWeb.client.OrderWebManagerClient;
import com.ostrich.cloud.ostrichOrderService.client.OrderManagerClient;
import com.ostrich.cloud.ostrichOrderService.client.param.StoreOrderSearchParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.PreDestroy;
import javax.annotation.Resource;

@RestController
public class OrderManagerApiImp implements OrderWebManagerClient {

    @Resource
    private OrderManagerClient orderManagerClient;
//    @Override
//    public Result getOrderOnly(Integer current, Integer size, Integer businessmanId) {
//        StoreOrderSearchParam param=new StoreOrderSearchParam();
//        param.setBusinessmanId(businessmanId);
//        param.setSize(size);
//        param.setCurrent(current);
//
//        Result result = orderManagerClient.storeOrderSearch(param);
//        return result;
//    }

    @Override
    public Result getAllOrder(Long orderNo,Integer current, Integer size) {
        StoreOrderSearchParam param=new StoreOrderSearchParam();
        param.setSize(size);
        param.setCurrent(current);
        Result result = orderManagerClient.search(orderNo,current,size);
        return result;
    }
}
